<!DOCTYPE html
	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>卓越--拍卖信息发布</title>
		<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
		<link href="JsCss/common.css" rel="stylesheet" media="screen" type="text/css" />
		<script type="text/javascript" src="JsCss/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="JsCss/jquery.min.js"></script>
		<script type="text/javascript" src="JsCss/vue.min.js"></script>
		<script type="text/javascript" src="JsCss/axios.min.js" charset="utf-8"></script>
		<script type="text/javascript" src="JsCss/jquery.ui.widget.js"></script>
		<script type="text/javascript" src="JsCss/jquery.iframe-transport.js"></script>
		<script type="text/javascript" src="JsCss/jquery.fileupload.js"></script>
		<script src="JsCss/index.js"></script>
		<style type="text/css">
			#index a {
				margin: 5px 10px;
				text-decoration: none;
			}

			.indexSpan {
				margin: 10px;
			}

			.cz-con-text>span {
				margin-right: 20px;
			}

			.light {
				color: red;
			}
		</style>
	</head>

	<body>
		<div class="header">
			<ul class="top-link">
				<li class="pi"></li>
				<li class="title"><a target=_top href="register.html">注册</a></li>
				<li class="pi"></li>
				<li class="title"><a href="login.html">登录</a></li>
			</ul>

			<div class="logo"><a href="index.html"><img src="images/logo.png" width="250" height="82" /></a></div>
			<div class="menu">
				<ul>
					<li><a href="about.html">关于我们</a><span>about us</span></li>
					<li class="active"><a href="auction.html">拍卖信息</a><span>Auction information</span></li>
					<li><a href="product.html">商品展示</a><span>Product showcase</span></li>
					<li><a href="showData.html">个人信息</a><span>Personal information</span></li>
					<li><a href="chargeMoney.html">资金管理</a><span>Money management</span></li>

				</ul>
			</div>
		</div>

		<div class="clr50"></div>
		<div class="zy_banner_bg">
			<div class="zy_banner"></div>
		</div>



		<div class="zy_main" id="content">
			<div class="Left_subMenu">
				<div class="top_bg"></div>
				<div class="c_bg">
					<div class="title">拍卖信息</div>
					<ul>
						<li class="activer"><a href="auctioning.html">正在竞拍</a></li>
						<li><a href="showAuction.html">我的拍卖</a></li>
						<li><a href="auctioninsert.html">发布拍品</a></li>
						<li><a href="myOrder.html">我的订单</a></li>
					</ul>
				</div>
				<div class="bottom_bg"></div>

				<div class="ph">
					<img src="images/ph.png" width="169" height="67" />
				</div>
			</div>

			<div class="zy_right">
				<div class="position">当前位置：<a href="#">拍卖信息</a> > <a href="#">发布拍品</a></div>
				<div class="zy_title">
					<p>发布拍品<span>Auction information</span></p>
				</div>
				<br>

				<div>
					<select id="tid" class="cz-birds" style="width:200px;height: 24px" v-model="searchtype">
						<option value="">请选择</option>
						<option v-for="item in ptypelist" :value="item.tid">{{item.tname}}</option>
					</select>
					<input type="text" id="gname" placeholder="请输入商品名称..." v-model="searchname"/>
					<input type="button"  id="" value="查询"	style="width: 75px;" @click="query"/>
				</div>
				<div style="margin-top: 10px; overflow: auto;">
					<div style="width: 170px; float: left; margin-right: 20px; cursor: pointer;"
					     v-for="item in records">
						<div>
							<a :href="'auction.html?aid='+item.aid"><img :src="'http://localhost:9090/images/'+item.gpic" style="width:170px;height:170px" /></a>
						</div>
						<div style="text-align: center;">
							宝物名称：{{item.gname}}
						</div>
						
						<div style="text-align: center;">
							当前竞价：<span style="color: red;">{{item.nprice}}</span>
						</div>
						
					</div>
				</div>
				<br>
				<div id="index" style="text-align: center;">
					<span class="indexSpan">一共查询到{{total}}条记录 {{pages}}页</span>
					<span class="indexSpan">当前是第{{pageno}}页</span>
					<span class="indexSpan"><button :disabled="pageno==1?true:false" @click="pageno=pageno-1">上一页</button></span>
					<span class="indexSpan"><button :disabled="pageno==pages?true:false" @click="pageno=pageno+1">下一页</button></span>					
				</div>
				<div class="clr10"></div>
			</div>
		</div>


		<div id="footer-top">
			<div class="footer-text">
				© 小佟拍卖行
			</div>
		</div>

		<style>

		</style>
		<script>
			var vm = new Vue({
				el: '#content',
				data: {
					searchtype:'',
					searchname:'',
					pageno:1,
					ptypelist:[],
					records:[],
					pages:0,
					total:0
				},
				//查询类型列表
				created() {
					axios.get("/ptypes/all").then(resp=>{
						this.ptypelist = resp.data;
					});
					
					//查询所有正在竞拍的拍品
					this.query();
					
				},
				watch:{
					pageno:function(newval){
						this.query();
					}
				},
				methods: {
										
					query(){
						var params = "searchname="+this.searchname + "&searchtype="+this.searchtype + "&pageno="+this.pageno;
						axios.get("/auction/page?"+params)
						.then(resp=>{
							console.log(resp.data);
							this.records = resp.data.data.records;
							this.pages = resp.data.data.pages;
							this.total = resp.data.data.total;
							
						})
					}
				}
			});
			
		</script>
	</body>
</html>
